const fs = require('fs');
const path = require('path');


const basePath = path.join(__dirname);
const fileName = 'readme.txt';
const targetFileName = new Date().getTime() + parseInt(Math.random() * 1000) + '.' + fileName.split('.')[1]; 
const readableStream = fs.createWriteStream(path.join(basePath,'/srcPath/',fileName));

const writeStream = fs.createWriteStream(path.join(basePath,'/targetPath/',targetFileName));

readableStream.pipe(writeStream);